import App from './App'
import uView from '@/uni_modules/uview-ui'
import HeadCustom from '@/components/head-custom/index.vue';
import NotEmpty from '@/components/not-index/not-empty.vue';
import NotLogin from '@/components/not-index/not-login.vue';
import {pageTo} from './static/js/common.js';
import "./uni_modules/uview-ui/index.scss";
import {router,RouterMount} from './router/router.js'  //路径换成自己的

// 安装插件
Vue.use(uView)
Vue.use(router)
Vue.component("HeadCustom",HeadCustom)
Vue.component("NotEmpty",NotEmpty)
Vue.component("NotLogin",NotLogin)
Vue.prototype.$pageTo = pageTo;
// 微信分享SDK
// #ifdef H5
if(!window.location.href.includes('#/bks/')){
const {wxSdk} = require("@/static/js/wxjsdk.js")
wxSdk.init()
}
// #endif

// #ifdef H5
import Bridge from '@/static/js/bridge.js'
Vue.prototype.$bridge = Bridge;
Bridge.initHandler((message, responseCallback) => {
	const responseData = '初始化收收到来自Java的数据，回传数据给你'
	responseCallback(responseData)
	console.log('初始化收收到', message)
})
// #endif

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false 
App.mpType = 'app'
const app = new Vue({
    ...App
})
// app.$mount()
// #endif

//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
	RouterMount(app,router,'#app')
// #endif
// #ifndef H5
	app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif